<?php
    /*
    Plugin Name: Essayist
    Plugin URI: http://lairbob.com
    Description: Plugin for constructing essays out of modular componets
    Author: Laurent R.O. Stanevich
    Version: 0.0.1
    Author URI: http://lairbob.com
    */


		function signOffText() {
		    return 'Thank you so much for reading! And remember to subscribe to our RSS feed. ';
		}

		function findNote() {
			$args = array(
				'relationship' => 'AND',
				'post_type' => 'notes' ,
				'tax_query' => array (
					'taxonomy' => 'sidebars',
					'field' => 'title',
					'terms' => 'epidemiology',
					'operator' => 'IN'
				)
			);

			$myposts = get_posts( $args );

			$outString = '<ul>';

			foreach ( $myposts as $post ) :
				$outString .= '<li>'.$post->post_title.'</li>';
			endforeach ;
			$outString .= '</ul>';

			return $outString;
		}

		add_shortcode('signoff', 'signOffText');

		add_shortcode('notes', 'findNote');

?>